package com.home.qh.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.home.qh.dao.VoyageDao;
import com.home.qh.model.Itinerary;
import com.home.qh.model.Voyage;
import com.home.qh.service.VoyageManager;

/**
 * Implementation of RoleManager interface.
 *
 * @author <a href="mailto:dan@getrolling.com">Dan Kibler</a>
 */
@Service("voyageManager")
public class VoyageManagerImpl extends GenericManagerImpl<Voyage, Long> implements VoyageManager {
	VoyageDao voyageDao;

    @Autowired
    public VoyageManagerImpl(VoyageDao voyageDao) {
        super(voyageDao);
        this.voyageDao = voyageDao;
    }

	public List<Voyage> getVoyageByCodeAndName(String voyageCode,
			String voyageName) {
		return voyageDao.getVoyageByCodeAndName(voyageCode, voyageName);
	}

	public List<Voyage> getVoyageByVoyage(Voyage voyage, String sort, boolean desc, int startResult, int maxResults) {
		return voyageDao.getVoyageByVoyage(voyage, sort, desc, startResult, maxResults);
	}

	public List<Itinerary> getItinerariesByVoyage(long voyageId) {
		return voyageDao.getItinerariesByVoyage(voyageId);
	}

}